package me.sensen.commands;

import me.sensen.Main;
import me.sensen.commandfunction.Command;
import me.sensen.commandfunction.CommandExecutor;

/**
 * @author Sensen
 */
public class SetLocal implements CommandExecutor {
    @Override
    public void onCommand(Command command, String[] args) {
        if (args.length == 2) {
            if ("c".equals(args[0])) {
                switch (args[1].toLowerCase()) {
                    case "0":
                        Main.localPath = "F:\\Others\\setup";
                        System.out.println("Set successfully");
                        Main.checkPath();
                        break;
                    default:
                        System.out.println("Failed common value [0: setup]");
                }
                return;
            }
            System.out.println("No Usage -> maybe i should be 'setLocal c [0: setup]'");
            return;
        }
        if (args.length == 1) {
            Main.localPath = args[0];
            System.out.println("Set successfully");
            Main.checkPath();
            return;
        }
        System.out.println("No Usage -> maybe i should be 'setLocal [path]'");
    }
}
